<%@page import="com.kucun.bean.Users"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
response.setHeader("Pragma","No-cache"); 
response.setHeader("Cache-Control","no-cache"); 
response.setDateHeader("Expires", 0); 
Users user= (Users)request.getSession().getAttribute("user");
response.flushBuffer();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../css/index.css">
<link rel="stylesheet" type="text/css" href="../jquery-easyui-1.4.5/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../jquery-easyui-1.4.5/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../jquery-easyui-1.4.5/themes/color.css">
<script type="text/javascript" src="../jquery-easyui-1.4.5/jquery.min.js"></script>
<script type="text/javascript" src="../jquery-easyui-1.4.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../js/clientinfo.js"></script>
<script type="text/javascript" src="../js/validateUtil.js"></script>
<script type="text/javascript" src="../jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js"></script>
<title>客户管理</title>
<script type="text/javascript">
   var path="<%=basePath%>";
   var role="<%=user.getPower()%>"; 
</script>
</head>
<body class="easyui-layout">
<div data-options="region:'north',border:false" style="height:50px;background-color: #F2F5F7;">
<div id="searth" style="font-size: 12px;">
搜索字段：<input class="easyui-searchbox" style="width:300px" data-options="menu:'#mm',
prompt:'请选择字段后再输入',height:30,searcher:function(value,name){searcherDate(value,name)}" />
<div id="mm" style="width:150px">
	<div data-options="name:'clientname',selected:true">客户姓名</div>
	<div data-options="name:'qq'">企鹅号</div>
	<div data-options="name:'email'">电子邮箱</div>
	<div data-options="name:'tel'">联系电话</div>
	<div data-options="name:'isused'">是否启用</div>
</div>
</div>
</div> 
<div region="center"  split="true"   title="客户信息" style="overflow: hidden;">
<table id="goods"></table>
</div> 
<!-- 右键菜单 -->
  	<div id="div_rightmenu" class="easyui-menu" style="width:80px;">   
  		 <div data-options="iconCls:'icon-add'" onclick='add_child(0)'>新增客户</div>    
         <div data-options="iconCls:'icon-edit'" onclick='edit_org()'>编辑客户</div>  
         <div data-options="iconCls:'icon-cancel'" onclick='del()'>删除客户</div> 
  	</div>


  	<!-- 添加子节点、编辑节点、添加同级节点 -->
  	<div id="div_node" class="easyui-dialog" style="width:300px;height:400px;closed:true" data-options="title:'编辑客户数据',modal:true,closed:true,buttons:[{text:'确定', handler:function(){savedate(this)} },{text:'关闭', handler:function(){$('#goods').datagrid('reload');$('#div_node').window('close')} }]">
  		<form name="form_node" id="form_node" method="post">
  			<p>
  			<table align="center" style="line-height: 45px;">
  				<tr style="display: none;">
  					<td>
  					<input type="hidden" name="tag" id="tag"/>
  					<input type="hidden" name="id"  id="id"/>
  					</td><!-- flag==0表示添加，flag=1表示编辑 -->
  				</tr>
  				<tr>
  					<td>客户名称：</td>
  					<td><input type="text" name="clientname" id="clientname" class="easyui-textbox" data-options="required:true"/></td>
  				</tr>
  				<tr>
  					<td>联系人：</td>
  					<td><input type="text"  name="qq" id="qq" class="easyui-textbox" /></td>
  				</tr>
  				<tr>
  					<td>联系电话：</td>
  					<td><input type="text" name="tel" id="tel" class="easyui-numberbox"  data-options="required:true,validType:'mobile'"/></td>
  				</tr>

  				<tr>
  					<td>电子邮箱：</td>
  					<td><input id="email" name="email" class="easyui-validatebox" data-options="validType:'email'" /> </td>
  				</tr>
  				<tr>
				     <td>是否启用：</td>
				     <td>
			<select id="isused"  name="isused" style="width:150px;">   
		    <option value="0">停用</option>   
		    <option value="1">启用</option>    
		</select>
				     </td>
				   </tr>
  				
  			</table>
  			
  			
  		</form>
  	</div>
  	
  	
  	
  	<!-- 删除 -->
  	<div id="div_rightmenu_person" class="easyui-menu" style="width:80px;">  
  		 <div data-options="iconCls:'icon-add'"  onclick='add_person()'>增加人员</div>   
  		 <div data-options="iconCls:'icon-remove'" onclick='remove_person()'>移除组织</div>   
  	</div>
  	
  	<div id="div_window" style="display: none;">
  		<form action="" id="operateform">
  			<table align="center" style="line-height: 35px;">
  				<tr>
  					<td>组织架构：</td>
  					<td><input type="text" name="orgid"   id="edit_org"   /></td>
  				</tr>
  				<tr>
  					<td>操作人员：</td>
  					<td><input type="text" name="userids"   id="edit_userids"  style='width:250px;'  /></td>
  				</tr>
  				<tr>
  					<td colspan="2" align="center">
  						<button id="btnedit_save" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">保存</button>
  					</td>
  				</tr>
  			</table>
  		</form>
  	</div>  
</body>
</html>